<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>{:C('SITE_TITLE')}</title>
	<meta name="description" content="{:C('SITE_KEYWORDS')}" />
	<meta name="keywords" content="{:C('SITE_DESCRIPTION')}" />
	<link  type="text/css"  rel="stylesheet"  href="__THEME__/css/probuy.css">
	<link  type="text/css"  rel="stylesheet"  href="__THEME__/css/style.css">
	<link  type="text/css"  rel="stylesheet"  href="__THEME__/css/easyDialog.css">
	<script  type="text/javascript"  src="__THEME__/js/jquery-1.8.3.min.js"></script>
	<script  type="text/javascript"  src="__THEME__/js/template-global.js"></script>
	<script  type="text/javascript"  src="__THEME__/js/ShoppingCart.js"></script>
</head>
<body  id="body">
<include file="Public/head" />
<!-- 内容部分 开始 -->

<style>
/*留言板样式*/
.guestbook-box{

}
.guestbook-box > .tit{
	font-weight: normal;
	font-size: 18px;
	margin-bottom: 10px;
	padding-bottom: 5px;
	border-bottom: 2px solid #ccc;
}
.guestbook-box .msg-box{
	border-bottom: 1px solid #E6E6E6;
}
.guestbook-box .msg-box > .tit{
	padding: 5px 10px;
	color: #31708F;
	background-color: #D9EDF7;
}
.guestbook-box .msg-box > .con{
	padding: 10px 20px;
}
.guestbook-box .msg-box > .fot{
	line-height: 2;
	border-top: 1px dashed #E6E6E6;
	padding: 10px 20px;
}
.guestbook-box .code-img{
	cursor: pointer;
}
.alert{
	position: relative;
	padding: 8px 35px 8px 14px;
}
.alert{
	color: #31708f;
	background-color: #d9edf7;
	border:1px solid #bce8f1;
}
input,textarea{
	padding: 2px 5px;
};
</style>
<!-- 列表焦点图 -->
<div  class="sub-banner">
	<div  style="width:1000px;float:left;height:260px;"><img  src="__THEME__/images/635176068177682516186.jpg"  style="width:1000px;height:260px;"> </div>
</div>
<!-- 单页内容 -->
<div  class="content-container sub-contaner clearfix">
	<div  class="sub-sidebar">

		<div  id="Panel_980"  class="panel-box"  style="clear:both;overflow:hidden;">
			<div  class="sb-contact">
				<div  class="h-contactIntrobox">

					<!-- 联系我们栏目链接 -->
					<category cid="83">
					<a  href="{$v.url}"><img  src="__THEME__/images/contact_pic1.jpg" title="{$v.title}"></a>
					</category>
					<!-- 联系我们栏目链接 -->

				</div>
			</div>
		</div>
		
	</div>
	<div  class="sub-mainbox">
		<div  class="panel-box">
			<div  id="Panel_654"  class=""  style="clear:both;overflow:hidden;">

				<div  class="h-titType2">
					<h3  class="tit">{$CATEGORY.title}</h3>
					<div  class="breadnav">

						<!-- 当前位置 -->
						<position cid="$CID" />
						<!-- 当前位置 -->

					</div>
				</div>

				<div  class="panel-bdbox">
					<div class="guestbook-box">
						<div class="con">
							
							<foreach name="list" item="v">
							<div class="msg-box">
								<div class="con">
									{$v.username}留言: {$v.content} 
									<span class="fr">留言时间: {$v.add_time}</span>
								</div>
								<notempty name="v.reply">
								<div class="fot">
									管理员回复：{$v.reply}
									<span class="fr">回复时间: {$v.reply_time}</span>
								</div>
								</notempty>
							</div>
							</foreach>
						</div>
						<div class="page tr" style="margin-top:10px;">
							{$page}
						</div>

						<div  class="h-titType2" style="margin-top:20px;"><h3  class="tit">现在留言</h3></div>
						<div class="fot">
							
							<form id="Form" action="{:U('/Guestbook')}" method="post">
								<table style="width:100%;">
									<tr height="40">
										<td width="10%">昵称: </td>
										<td><input id="username" type="text" name="username"></td>
										<td width="10%">电话:</td>
										<td><input id="mobile" type="text" name="mobile"></td>
									</tr>
									<tr>
										<td>留言:</td>
										<td colspan="3"><textarea name="content" style="width:80%;height:60px;"></textarea></td>
									</tr>
									<tr>
										<td>验证码:</td>
										<td colspan="3">
											<input type="text" name="code" size="10">
											<img id="CodeImg" class="code-img" src="{:U('Public/verify',array('w'=>100,'h'=>25),'',true)}" alt="验证码">
										</td>
									</tr>
									<tr height="40">
										<td></td>
										<td colspan="3">
										<input class="btn-blue btn-big" type="submit" value="提交留言" style="padding:2px 17px;">
										<span id="AlertMsg"></span>
										</td>
									</tr>
								</table>
							</form>
						</div>
<script>
$(function(){

	//刷新验证码
	var verifyimg = $("#CodeImg").attr("src");
    $("#CodeImg").click(function(){
        if( verifyimg.indexOf('?')>0){
            $("#CodeImg").attr("src", verifyimg+'&random='+Math.random());
        }else{
            $("#CodeImg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
        }
    });
    //防止重复提交
	$(document).ajaxStart(function(){
	    $("input:submit").attr("disabled", true);
	}).ajaxStop(function(){
	    $("input:submit").attr("disabled", false);
	});
	//验证提交
	$("#Form").submit(function(){
		var self = $(this);
		//验证规则
		var msg='';
		if(self.find("#username").val() == '') msg+='请填写留言昵称,';
		if(self.find("#mobile").val() == '') msg+='请填写联系电话';
		if(msg != '') { self.find("#AlertMsg").addClass('red').show().text(msg);return false; }

		//提交
		$.post(self.attr("action"), self.serialize(), success, "json");
		return false;

		function success(data){
			if(data.status){
				self.find("#AlertMsg").removeClass('red').addClass('green').show().text(data.info);
				setTimeout(function() {
					window.location.href = data.url;
				}, 1000);
				
			} else {
				self.find("#AlertMsg").addClass('red').show().text(data.info);
				//刷新验证码
				$("#CodeImg").click();
			}
		}
		
	});
});
</script>
					</div>
				</div>
			</div>
		</div>

	</div>
</div>


<!-- 内容部分 结束 -->
<include file="Public/foot" />
</body>
</html>